<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>获取两个 set 的交集</title>
</head>
<body>
    
</body>
</html>
<script>
    var set1 = new Set ([4,5,6]);
    var set2 = new Set ([6,7,5]);
    var arr = new Set([...set1].filter(i=>set2.has(i)));
    console.log(arr);
</script>